﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>TreeGrid 树形表格</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" /><link href="../demo.css" rel="stylesheet" type="text/css" />

    <script src="../../scripts/boot.js" type="text/javascript"></script>
	<script src="js/treesort.js" type="text/javascript"></script>
	
</head>
<body>
    <h1>树排序</h1>
	
    
<div id="treegrid1" class="mini-treegrid" style="width:700px;height:280px;"     
    url="../data/tasks.txt" showTreeIcon="true" 
    treeColumn="taskname" idField="UID" parentField="ParentTaskUID" resultAsTree="false"  
    allowResize="true" expandOnLoad="true"		 allowSortColumn="false" sortMode="client"
>
    <div property="columns">
        <div type="indexcolumn"></div>
        <div name="taskname" field="Name" width="160" allowSort="true">任务名称</div>
        <div field="PercentComplete" width="80" allowSort="true">进度</div>
        <div field="Duration" width="60" align="right" allowSort="true">工期</div>
        <div field="Start" width="80" dateFormat="yyyy-MM-dd" allowSort="true">开始日期</div>
        <div field="Finish" width="80" dateFormat="yyyy-MM-dd" allowSort="true">完成日期</div>                   
    </div>
</div>

    <div class="description">
        <h3>Description</h3>
        <p>点击列头可以进行树排序。
        </p>
        
    </div>

</body>
</html>
<script type="text/javascript">
	mini.parse();
	var data = [{ Name: 1, id: 1, children: [{ id: 11, Name: 15 }, { id: 12, Name: 13 }, { id: 13, Name: 14}] }, { Name: 2, id: 2}]
    
	/////////////////////////////////////////////////

	var tree = mini.get("treegrid1");
	//tree.loadData(data);

	var sorter = new TreeSort(tree);

	//sorter.sort("Duration", "desc");

</script>
